import cv2
import os

path_in = "/media/cjg/Elements/pano20210902/20210901_video/mask3.jpg"
path_out = "/media/cjg/Elements/pano20210902/20210901_video/mask4.jpg"
frame = cv2.imread(path_in, 0)

scale_percent = 50
width = int(frame.shape[1] * scale_percent / 100.0)
height = int(frame.shape[0] * scale_percent / 100.0)
dim = (width, height)

frame1 = cv2.resize(frame, dim, interpolation=cv2.INTER_AREA)
cv2.imwrite(path_out, frame1)
